# coding: utf-8
from application import db
from common.models.user import User
from common.models.department import Department


class UserChange(db.Model):
    __tablename__ = 'user_change'

    id = db.Column(db.Integer, primary_key=True)
    userid = db.Column(db.Integer,db.ForeignKey('user.id'))
    user = db.relationship('User', foreign_keys=userid)
    bdepid=db.Column(db.Integer,db.ForeignKey('department.id'))
    bdep = db.relationship('Department', foreign_keys=bdepid)
    adepid=db.Column(db.Integer,db.ForeignKey('department.id'))
    adep = db.relationship('Department', foreign_keys=adepid)
    bpost = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))
    apost = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))
    bz = db.Column(db.String(255, 'utf8mb4_0900_ai_ci'))
    changedate= db.Column(db.Date)
    bpmid=db.Column(db.String(50, 'utf8mb4_0900_ai_ci'))
    updated_time = db.Column(db.DateTime)
    created_time = db.Column(db.DateTime)